`_arguments` util. function for build scope specs
authorzv <zv@nxvr.org>
Fri, 9 Oct 2015 06:37:06 +0000 (23:37 -0700)
committerzv <zv@nxvr.org>
Fri, 9 Oct 2015 06:37:06 +0000 (23:37 -0700)
Includes a shared and mutally exclusive build scope specifier for:
 * --bin
 * --example
 * --test
 * --lib
 * --bench

src/etc/_cargo

index 197cdb4222bc3ee285cbb6cb3b771ac3d6f1192e..b650fea50518b1bb2ba1ecc64aa402d68916b251 100644 (file)
@@ -341,6 +341,15 @@ _get_names_from_array()
 
 }
 
+# Returns the shared argument style for build specifiers
+_build_scope_spec() {
+    '(--bin --example --test --lib)--bench=[benchmark name]: :_benchmark_names' \
+        '(--bench --bin --test --lib)--example=[example name]' \
+        '(--bench --example --test --lib)--bin=[binary name]' \
+        '(--bench --bin --example --test)--lib=[library name]' \
+        '(--bench --bin --example --test)--test=[test name]' \
+}
+
 #Gets the test names from the manifest file
 _test_names()
 {